<?php
class ControllerInformationantiaging extends Controller { 

     public function index() {
      	 

       	$this->document->setTitle('Анти стареене'); // Optional. Set the title of your web page.

		$this->data['breadcrumbs'] = array(); // Breadcrumbs for your website. 
		$this->data['breadcrumbs'][] = array(
			'text'			=> $this->language->get('text_home'),
			'href'			=> '/',           
			'separator'		=> false
		);
		$this->data['breadcrumbs'][] = array(
			'text'			=> 'Анти стареене',
			'href'      	=> '/анти-стареене',
			'separator' 	=> $this->language->get('text_separator')
		);   
		
		
		$this->load->model('catalog/information');
		$this->load->model('tool/image'); 
		$this->data['anti'] = array();
		$this->data['consult'] = array();

		foreach ($this->model_catalog_information->getInformations() as $result) {
			
			if ($result['image']) {
					$image = $this->model_tool_image->resize($result['image'],79, 79);
				} else {
					$image = '';
				}
				
			if ($result['anti']) {
				$this->data['anti'][] = array(
					'title' => $result['title'],
					'image' => $image,
					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
				);	
			}
			
			if ($result['consult']) {
				
				$this->data['consult'][] = array(
					'title' => $result['title'],
					'image' => $image,
					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
				);	
			}
    	}
		
		

		// Text from language file
		$this->data['heading_title']	= $this->language->get('heading_title'); // Get "heading title" from language file. $this->data['something'] will allow you to call for this variable from the template file.
		$this->data['text_content']	= $this->language->get('text_content');

		// We call this Fallback system
      if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/antiaging.tpl')) { // if file exists in your current template folder
         $this->template = $this->config->get('config_template') . '/template/information/antiaging.tpl'; // get it
      } else {
         $this->template = 'default/template/information/antiaging.tpl'; // or else get the file from the default folder (this is a fall back folder) always remember to have your template file in the default folder.
      }
      
      $this->children = array( // Required. The children files for the page.
         'common/column_left', // Column left which will allow you to place modules at the left of your page.
         'common/column_right',
         'common/content_top',
         'common/content_bottom',
         'common/footer', // your footer of your website
         'common/header'
      );
		
      $this->response->setOutput($this->render()); // Let's display it all!
     }
}
?>